package com.kgc.provider;

import com.alibaba.dubbo.config.annotation.Service;
import com.kgc.api.buylimit.SnapupApi;
import com.kgc.bean.BuyLimitActivity;
import com.kgc.bean.BuyLimitItem;
import com.kgc.mapper.BuyLimitActivityMapper;
import com.kgc.mapper.BuyLimitItemMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Author：周申宇 <p>
 * @Date:2021/6/21 13:44
 * <p>
 * @Decription: 抢购业务的提供者
 */
@Service
public class SnapupProvider implements SnapupApi {

    @Autowired
    private BuyLimitItemMapper buyLimitItemMapper;

    @Autowired
    private BuyLimitActivityMapper buyLimitActivityMapper;


    @Override
    public BuyLimitActivity selectActivityById(Integer activityId) {
        return buyLimitActivityMapper.selectActivityId(activityId);
    }

    @Override
    public List<BuyLimitItem> selectActivityItemsByActivityId(Integer activityId) {
        return buyLimitItemMapper.selectBuyLimitItemsById(activityId);
    }
}
